package com.itheima.service.impl;

import com.itheima.dao.UserDao;
import com.itheima.pojo.User;
import com.itheima.service.UserService;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;

/**
 * @author huyoufu <https://github.com/huyoufu>
 * @TIME 2020-08-06 10:20
 * @description
 */
//@Component
@Service
public class UserServiceImpl implements UserService {
    //肯定需要 dao的!!!
    private UserDao userDao;
    /*通过属性注入的时候 实际上只需要set可以就可以了!!!!*/
    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    @Override
    public User login(String username, String password) {
        return userDao.findUserByUsernameAndPassword(username,password);
    }
}
